dateItems
Type
keyword
Summary
Designates a comma-delimited date format used with the convert command.
Syntax
dateItems
Description
Use the dateItems keyword with the convert command to store a date and/or time.
The dateItems format is a comma-separated list of numbers:
- the year
- the month number
- the day of the month
- the hour in 24-hour time
- the minute
- the second
- the numeric day of the week where Sunday is day 1, Monday is day 2, and so forth
The dateItems does not change depending on the user's settings, so you can use it (or the seconds format) to store a date and time in an invariant form that won't change.
A list in dateItems format can have values beyond the expected range for any given item (e.g. a day of the month of less than 1 or greater than the number of days in that month) without causing issues when converting it again later, outputting a date adjusted for such an irregularity. For example, the date 4 weeks from today can be determined by adding 28 to the third item (i.e. the day of the month) and then re-converting.
put the date into foo -- 9/19/19, for example
convert foo to dateItems -- 2019,9,19,0,0,0,5
add 28 to the item 3 of foo -- 2019,9,47,0,0,0,5
convert foo to date -- 10/17/19
Examples
convert myVariable to dateItems
convert it from dateItems to long date and long time
Related
command: convert
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile